using System;
using System.Collections.Generic;
using System.Text;
using OgilvyOne.Model;
using OgilvyOne.BLL.SysManage;
using System.Web;
using OgilvyOne.Utility;

namespace OgilvyOne.ProcessFlow.SysManage
{
    public class PrivilegeController
    {
        // Fields
        private const string URL_DEFAULT = "/systemmanage/role/role_list.aspx";

        // Methods
        public bool Create(PrivilegeInfo newInfo, string sCurPage)
        {
            try
            {
                Privilege privilege = new Privilege();
                if (privilege.Insert(newInfo) < 1)
                {
                    return false;
                }
                HttpContext.Current.Response.Redirect(URL_DEFAULT+"?page=" + sCurPage, true);
            }
            catch (Exception exception)
            {
                string sMethod = "OgilvyOne.ProcessFlow.privilegeController.Create(PrivilegeInfo newInfo, string sCurPage)";
                EventsLog.WriteLog(exception, sMethod);
                return false;
            }
            return true;
        }

    }
}
